#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include <queue>
#include <vector>
using namespace std;

struct TreeNode {
     int val;
     TreeNode *left;
     TreeNode *right;
     TreeNode() : val(0), left(nullptr), right(nullptr) {}
     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
 };

class Solution 
{
public:
    vector<vector<int>> levelOrder(TreeNode* root)
    {
        vector<vector<int>> ret;
        if (root == nullptr)
            return ret;

        queue<TreeNode*> que;
        que.push(root);
        int count = 1;

        while (!que.empty())
        {
            vector<int> tmp;
            while (count--)
            {
                TreeNode* front = que.front();
                if (front == nullptr)
                {
                    que.pop();
                    continue;
                }
                tmp.push_back(front->val);
                if (front->left) que.push(front->left);
                if (front->right) que.push(front->right);
                que.pop();
            }
            ret.push_back(tmp);
            count = que.size();
        }
        return ret;
    }
};
//int main()
//{
//    TreeNode* n15 = new TreeNode(15);
//    TreeNode* n7 = new TreeNode(7);
//    TreeNode* n20 = new TreeNode(20, n15, n7);
//    TreeNode* n9 = new TreeNode(9);
//    TreeNode* n3 = new TreeNode(3, n9, n20);
//
//    Solution().levelOrder(n3);
//
//    delete n3;
//    delete n7;
//    delete n9;
//    delete n15;
//    delete n20;
//	return 0;
//}

//class Solution
//{
//public:
//    void InOrderConvert(TreeNode* cur, TreeNode*& prev)
//    {
//        if (cur == nullptr)
//        {
//            return;
//        }
//        InOrderConvert(cur->left, prev);
//
//        cur->left = prev;
//        if (prev != nullptr)
//        {
//            prev->right = cur;
//        }
//        prev = cur;
//
//        InOrderConvert(cur->right, prev);
//
//    }
//    TreeNode* Convert(TreeNode* pRootOfTree)
//    {
//        TreeNode* prev = nullptr;
//        InOrderConvert(pRootOfTree, prev);
//
//        TreeNode* head = pRootOfTree;
//        while (head && head->left)
//        {
//            head = head->left;
//        }
//        return head;
//    }
//};

//#include <iostream>
//using namespace std;
//#include <vector>
//#include <string>
//
//int main()
//{
//    string input;
//    getline(cin, input);
//
//    vector<string> result;
//    //input.reserve(21000);
//    string::iterator left = input.begin();
//    string::iterator right = input.begin();
//
//    int flag = 1;
//    while (left <= right && right != input.end())
//    {
//        if (*right == '"')
//        {
//            flag ^= 1;
//        }
//        if (flag && *right == ' ')
//        {
//            result.push_back(string(left, right));
//            left = right + 1;
//        }
//        right++;
//    }
//
//    if (left <= right)
//    {
//        result.push_back(string(left, right));
//    }
//
//    cout << result.size() << endl;
//    for (auto& str : result)
//    {
//        cout << str << endl;
//    }
//    return 0;
//}


#include <iostream>
using namespace std;
#include <vector>
#include <algorithm>

bool isLuck(vector<int>& xi, int left, int right)
{
    int sum = 0, product = 1;
    while (left < right)
    {
        sum += xi[left];
        product *= xi[left];

        left++;
    }

    return sum > product;
}

int main()
{
    int n;
    vector<int> xi;
    cin >> n;
    int x;
    for (int i = 0; i < n; i++)
    {
        cin >> x;
        xi.push_back(x);
    }

    sort(xi.begin(), xi.end());

    int count = 0;
    int left = 0;
    int right = left + 1;
    while (left < right && right < xi.size())
    {
        if (isLuck(xi, left, right))
        {
            count++;
            right++;
        }
        else
        {
            left++;
        }
    }
    while (left < right)
    {
        if (isLuck(xi, left, right))
        {
            count++;
        }
        left++;
    }
    cout << count << endl;
    return 0;
}